package com.heima.search.pojo;

import com.heima.model.article.dtos.ArticleDto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ArticleDoc {
    private Long id;
    private Date publishTime;
    private Integer layout;
    private String images;
    private String staticUrl;
    private String authorName;
    private String  labels;
    private String  channelName;
    private String  title;
    private String  content;

    public ArticleDoc(ArticleDto dto){
        this.id = dto.getId();
        this.publishTime = dto.getPublishTime();
        this.layout = dto.getLayout();
        this.images = dto.getImages();
        this.staticUrl = dto.getStaticUrl();
        this.authorName = dto.getAuthorName();
        this.labels = dto.getLabels();
        this.channelName = dto.getChannelName();
        this.title = dto.getTitle();
        this.content = dto.getContent();
    }


}